exports.getNoticeInfo = function (req, res) {

    var restfulParams = req.routeInfo.restfulParams;

    var resultData = {};

    var noticeId = 0;

    var noticeType = 0;

    var member = [];

    console.log(restfulParams)

    //获取通知信息
    function searchNotice(cb) {

        R.SEND_HTTP(
            req,
            res,
            {
                url: CORE_APIConfig.coreAPI.cmsNoticeSearch.Request_Api_Url + "/cn_id/" + restfulParams.cn_id,
                method: 'GET'
            },
            function (data) {

                resultData.noticeData = data.result.data;

                noticeId = data.result.data[0].cn_id;

                noticeType = data.result.data[0].cn_type;

                cb();

            }
        )
    }

    //查询对应会员信息
    function searchMemberBelongsNotice(cb) {
        if (noticeType > 0) {
            R.SEND_HTTP(
                req,
                res,
                {
                    url: CORE_APIConfig.coreAPI.cmsMemberNoticeSearch.Request_Api_Url + "/cmn_cnid/" + noticeId + "/cmn_is_delete/0",
                    method: 'GET'
                },
                function (data) {

                    var memberNotice = data.result.data

                    if (memberNotice.length > 0) {
                        for (var i = 0; i < memberNotice.length; i++) {
                            member.push({cm_id: memberNotice[i].cmn_cmid})
                        }
                    }
                    resultData.memberArr = member;
                    cb();
                }
            )
        } else {
            resultData.memberArr = member;
            cb()
        }
    }

    F.Serial([
        searchNotice,
        searchMemberBelongsNotice
    ], () => {
        RES.successResponse(res, resultData);
    })

}